﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class RptutilidadFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As RptutilidadBE
        Dim tmpRptutilidad As RptutilidadBE = New RptutilidadBE()
        Try
            With tmpRptutilidad
                .Cantidad = convertDTFromDb.ConvertDecimal(dr.Item("Cantidad"))
                .Clave = convertDTFromDb.ConvertString(dr.Item("Clave"))
                .Costo = convertDTFromDb.ConvertDecimal(dr.Item("Costo"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .Familia = convertDTFromDb.ConvertString(dr.Item("Familia"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .Porc1 = convertDTFromDb.ConvertDecimal(dr.Item("Porc1"))
                .Porc2 = convertDTFromDb.ConvertDecimal(dr.Item("Porc2"))
                .Usr = convertDTFromDb.ConvertString(dr.Item("Usr"))
                .Utilidad = convertDTFromDb.ConvertDecimal(dr.Item("Utilidad"))
                .Venta = convertDTFromDb.ConvertDecimal(dr.Item("Venta"))
            End With
            Return tmpRptutilidad
        Catch ex As Exception
            Throw
        Finally
            tmpRptutilidad = Nothing
        End Try
    End Function
End Class
